//part1:C03:ex3.15.cpp
//read some characters, then store to one vector.
#include <iostream>
#include <vector>
#include <string>

int main(void)
{
    using namespace std;
    vector<string> vString;
    string s;
    char tocontinue1 = 'y';
    
    while (cin >> s)
    {
        vString.push_back(s);
        cout << "to continue (y or n) ?\n";
        cin >> tocontinue1;
        if (tocontinue1 != 'y' && tocontinue1 != 'Y')
        {
            break;
        }
    }
    for (auto mem : vString)
    {
        cout << mem << " ";
    }
    cout << endl;

    return 0;
}